package com.gopay.bis.service.bank.cbrmb.impl;

import javax.annotation.Resource;

import org.apache.commons.lang.builder.ReflectionToStringBuilder;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.gopay.bis.manager.bank.cbrmb.CbRmbCcbBankManager;
import com.gopay.bis.service.bank.cbrmb.CbRmbCcbBankService;
import com.gopay.common.domain.bank.ccb.cbrmb.req.CbRmbNotificationMsg;
import com.gopay.common.domain.bank.ccb.cbrmb.req.CbRmbQueryReqMsg;
import com.gopay.common.domain.bank.ccb.cbrmb.res.CbRmbQueryRespMsg;
import com.gopay.common.domain.bank.ccb.cbrmb.res.CbRmbResponseMsg;
import com.gopay.common.exception.GopayException;

/**
 * 
 * @ClassName: CbRmbCcbBankServiceImpl
 * @Description: 跨境银行接口实现
 * @author gd.cui
 * @date 2016年7月1日 上午9:37:23 ww.gopay.com.cn Inc.All rights reserved.
 */
@Service("cbRmbCcbBankService")
public class CbRmbCcbBankServiceImpl implements CbRmbCcbBankService {
    
    private static final Logger logger = LoggerFactory.getLogger(CbRmbCcbBankServiceImpl.class);

    @Resource(name = "cbRmbCcbBankManager")
    private CbRmbCcbBankManager cbRmbCcbBankManager;

    @Override
    public CbRmbResponseMsg submit(CbRmbNotificationMsg msg) throws GopayException {
        logger.error("=========this is bis service =============" + ReflectionToStringBuilder.toString(msg));
        return cbRmbCcbBankManager.submit(msg);
    }

	@Override
	public String callBIS(CbRmbNotificationMsg msg,CbRmbResponseMsg responseMsg) throws GopayException {
		logger.info("this is bis-bank-cbrmb call bis ");
		return cbRmbCcbBankManager.callBIS(msg,responseMsg);
	}

	@Override
	public String findCbRmbCcbResultByGopayOrderId(String goapayOrderId) throws GopayException {
		return cbRmbCcbBankManager.findCbRmbCcbResultByGopayOrderId(goapayOrderId);
	}

	@Override
	public CbRmbQueryRespMsg findCbRmbCcbResult(CbRmbQueryReqMsg reqMsg) throws GopayException {
		return cbRmbCcbBankManager.findCbRmbCcbResult(reqMsg);
	}
    
    

}
